const BASE_URL = 'http://localhost:8090'

export const request = (options => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: BASE_URL + options.url,
			data: options.data || {},
			method: options.method,
			header: {
				'Content-Type': 'application/json;charset=UTF-8',
			},
			dataType:'json',
			success: (res) => {
				resolve(res)
			},
			fail: (res) => {
				uni.showToast({
					title: '连接错误',
					icon: 'error',
					duration: 500
				});
				console.log(err)
				reject(err)

			}
		})
	})
})
